import request from "@/utils/request";
/**
 * 获取报表导出列表
 * @returns
 */
export const getExportListApi: IGetExportListApi = function(params) {
  return request.get(`htscrm/download/export`, { params })
}

/**
* 获取报表导出状态列表
* @returns
*/
export const getExportStatusListApi = function () {
  return request.get('htscrm/download/export/status')
}

/**
* 批量删除
* @returns
*/
export const deleteMultiApi = function (data: Record<string, any>) {
  return request.delete('htscrm/download/export/deleteMulti', data)
}

/**
* 获取报表导出类型
* @returns
*/
export function getExportKeyListApi() {
  return request.get('htscrm/download/export/type')
}

/**
* 报表导出
* @returns
*/
export function exportDataApi(type: string, params: Record<string, any>) {
  return request.get(`htscrm/download/export/${ type }`, { params, showErrorMessage: true })
}

/**
* 报表导出数据检查
* @returns
*/
export function exportDataCheckApi(type: string, params: Record<string, any>) {
  return request.get(`htscrm/download/export/check/${ type }`, { params })
}

/**
* 报表删除
* @param id
*/
export function deleteExportApi(id: number) {
  return request.delete(`htscrm/download/export/${ id }`, { showSuccessMessage: true })
}